#ifndef DATA_FILTER_H
#define DATA_FILTER_H

typedef int TXYINT32;
typedef unsigned int TXYUINT32;
typedef unsigned char TXYUINT8;
typedef unsigned short int TXYUINT16;
typedef unsigned char TXYBOOL;

#define TXY_OK 0
#define TXY_ERR_BASE 0x2000

#define TXYTRUE 1
#define TXYFALSE 0
#define TXYUINT8_INVALID 0
#define TXYUINT16_INVALID 0
#define TXYUINT32_INVALID 0

#define TXY_PTR_INVALID NULL

/*。起始码：*/
#define TXY_DEF_COMMU_SERIAL_CMMD_START_CODE (0xAA)
#define TXY_DEF_COMMU_SERIAL_CMMD_TAIL_CODE (0x55)
/*。命令头（起始码、长度）长度：命令在长度前所有字段的长度（包含命令长度字段）*/
#define TXY_DEF_COMMU_SERIAL_CMMD_HEAD_LENB_LEN (2)
/*。命令中命令内容的步进：*/
#define TXY_DEF_COMMU_SERIAL_CMMD_CONTEXT_STE (5)
/*。命令非内容长度：除去内容的命令长度，是固定的。包括起始码、结束码、校验和、命令ID、命令类型、内容长度*/
#define TXY_DEF_COMMU_SERIAL_CMMD_NCONTEXT_LEN (7)
/*。命令的最小长度：包括命令头（起始码和长度）和命令内容（最少一个字节），以及校验码和结束码。*/
#define TXY_DEF_COMMU_SERIAL_CMMD_LEN_MIN (8)
/*。命令的最大长度：报文最大长度*/
#define TXY_DEF_COMMU_SERIAL_CMMD_LEN_MAX (32)

/*。替换码：起始码；*/
#define TXY_DEF_COMMU_SERIAL_CMMD_RCODE_START_H (0x7D)
#define TXY_DEF_COMMU_SERIAL_CMMD_RCODE_START_L (0x5E)
/*。替换码：结束码；*/
#define TXY_DEF_COMMU_SERIAL_CMMD_RCODE_TAIL_H (0x7D)
#define TXY_DEF_COMMU_SERIAL_CMMD_RCODE_TAIL_L (0x5F)
/*。替换码：替换码；*/
#define TXY_DEF_COMMU_SERIAL_CMMD_RCODE_R_H (0x7D)
#define TXY_DEF_COMMU_SERIAL_CMMD_RCODE_R_L (0x5D)
/*。替换码：替换码本身；*/
#define TXY_DEF_COMMU_SERIAL_CMMD_RCODE_R_S (0x7D)

#endif // DATA_FILTER_H
